#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
	int r1,c1,r2,c2,i,j,aj,bi;//r行c列
    int a[10][10], b[10][10];//C为A行B列，每个位置为A行*B列之和
    while(~scanf("%d%d%d%d",&r1,&c1,&r2,&c2))
	{
        int c[10][10] = {0};
            for ( i = 0; i < r1; i++)
            for ( j = 0; j < c1; j++)
            scanf("%d", &a[i][j]);
            for ( i = 0; i < r2; i++)
            for ( j = 0; j < c2; j++)
            scanf("%d", &b[i][j]);

            if(c1!=r2)//A列=B行才可以相乘
            printf("0\n");
            
            else
            for ( i = 0; i < r1; i++)//C为A行B列
            {
              for ( j = 0; j < c2; j++)
              {
                for (aj = 0, bi = 0; aj < c1; aj++, bi++)
                {
                  c[i][j] = c[i][j] + a[i][aj] * b[bi][j];
                }
                printf("%d", c[i][j]);
                if(j<c2-1)
                printf(" ");
              }
              printf("\n");
            }
    }
	return 0;
}
